<?php

class App_View_Helper_UserInfo
{
    function userInfo($info)
    {
        $session = Zend_Registry::get('session');
        $storage = new App_Auth_Storage_Session($session);
        if (!$storage->isEmpty()){
        	$userInfo = array(
        		'userId' => $storage->getUserId(),
        		'userName' => $storage->getUserName(),
        		'userFirstName' => $storage->getFirstName(),
        		'userLastName' => $storage->getLastName(),
        		'userFullName' => $storage->getFirstName().' '.$storage->getLastName(),
        		'userRole' => $storage->getUserRole(),
        	    'lastLogin' => $storage->getLastLogin()
        	);
        	return $userInfo[$info];
        } 
        return null;
    }
}